# Agent Source Files
AGENTC = ./Agent/LeahAgent.c
AGENTH = ./Agent/LeahAgent.h

# Environment Source Files
ENVIRONMENTC = ./Environment/LeahEnv.c
ENVIRONMENTH = ./Environment/LeahEnv.h

# Experiment Source Files
EXPERIMENTC = ./Experiment/main.c
EXPERIMENTH = 

# Path to RL-Glue to find RL_interface and related files.
RL-GLUE = ../../RL-Glue

# Compiler flags
CC      = gcc
CFLAGS  = -I$(RL-GLUE)/ -ansi -pedantic -Wall
LDFLAGS =

# An example of RL-Glue compiled without using sockets 
all: agent.o environment.o experiment.o glue.o direct.o
	$(CC) -o RL_main Build/agent.o Build/environment.o Build/experiment.o Build/glue.o Build/direct.o

# Dependencies
agent.o: $(AGENTC) $(AGENTH)
	$(CC) -c $(CFLAGS) $(AGENTC) -o Build/agent.o

environment.o: $(ENVIRONMENTC) $(ENVIRONMENTH)
	$(CC) -c $(CFLAGS) $(ENVIRONMENTC) -o Build/environment.o

experiment.o: $(EXPERIMENTC) $(EXPERIMENTH)
	$(CC) -c $(CFLAGS) $(EXPERIMENTC) -o Build/experiment.o

glue.o: $(RL-GLUE)/RL_interface.c $(RL-GLUE)/RL_interface.h
	$(CC) -c $(CFLAGS) $(RL-GLUE)/RL_interface.c -o Build/glue.o

direct.o: $(RL-GLUE)/Direct/Glue/RL_direct_glue.c
	$(CC) -c $(CFLAGS) $(RL-GLUE)/Direct/Glue/RL_direct_glue.c -o Build/direct.o

clean:
	rm -fr Build/*.o

tidy:
	rm -fr *.*~
	rm -fr *~
	rm -fr \#*